<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/sys/include.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>"/>
<title>公告管理</title>
<link href="css/global.css" type="text/css" rel="stylesheet"/>
<script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
<%--
<script src="js/popw.js" type="text/javascript"></script>
 --%>
<link rel="stylesheet" type="text/css" href="css/easydialog.css" />
	<script src="js/easydialog.min.js" type="text/javascript"></script>
	
<style type="text/css">
<!--
body{
	background-color:#ffffff;
	margin:0px; padding:0px;
}
#pageStyle{
	text-align: center;
	margin-top: 4px;
}
#control{
	margin:0px;
	padding:0Px;
	text-align: right;
}

-->
</style>
<link rel="stylesheet" type="text/css" href="css/easydialog.css" />
<script src="js/easydialog.min.js" type="text/javascript"></script>
<script language="javascript">

//删除数据

function delData(data_id){
	
	
	easyDialog.open({
		overlay : true,//不加遮罩
		container : {
			header : '信息提示',
			content : '你确定要删除数据吗！',
			yesFn : function(){
					$.ajax({
			 			url:"sysDelBulletin.do",
			 			//防止浏览器缓存，在URL后加时间戳 "&timestamp=" + (new Date()).getTime()
			 			data:encodeURI("ids=" + data_id  + "&timestamp=" + (new Date()).getTime()),
			 			dataType:"json",
			 			async: false,//同步提交
			 			success:function(data){
			 				if("true".indexOf(data+"")>-1){
			 					//form刷新防提示
			 					window.location=window.location + "&timestamp=" + (new Date()).getTime();
								window.location.reload();
			 				}else{
									easyDialog.open({
										overlay : true,//不加遮罩
										container : {
											header : '信息提示',
											content : '操作失败！',
											yesFn : function(){
												return true;
											},
											noFn : true
										}
									});
			 				}
			 			}
			 		});
		
		
				
				return false;
			
			},
			
			noFn : true
		}
	});
	
}

//更新数据
function updateData(data_id){
	var url="sysBulletinUpdate.do?id="+data_id;
	//var winName = "更新角色";
	//openwindow(url,winName,600,400);
	window.location=url;
	window.reload();
}


//分配菜单
function settleMenu(data_id){
	var url="sysRoleSetMenu.do?id="+data_id;
	window.location=url;
	window.reload();
}

</script>
</head>
	<body>
		
		
		<div class="content">
			<form name="queryList" id="queryList" method="post" action="${pm.url}">
			
			<div id="control">
				<a href="javascript:void(0);" onclick="javascript:sysRoleExcel();"><img src="img/excel.png" class='dotimg' title="导出EXCEL文件" /></a>&nbsp;
				<a href="javascript:void(0);" onclick="javascript:window.location.reload();"><img src="img/reloadme.png" class='dotimg' title="刷新" /></a>&nbsp;&nbsp;
			</div>
			
			<table id="table" class="datatable" summary="list of members in EE Studay">
				<tr>
					<th scope="col" width="30">序号</th>
					<th scope="col">标题</th>
					<th scope="col">作者</th>
					<th scope="col">发布时间</th>
					<th scope="col">状态</th>
					<th scope="col" width="160">操作</th>
				</tr>
				
				<c:forEach items="${pm.data}" var="data" varStatus="status">
				<tr>
				<td style="text-align: center;">${status.index+pm.rowS}</td>
				<td>${data.title}</td>
				<td>${data.writer}</td>
				<td><fmt:formatDate value="${data.publishTime}" pattern="yyyy/MM/dd:HH:mm:ss"/> </td>
				<td>${data.bulState}</td>
				<td>
				<a href="javascript:void(0);" onclick="javascript:delData('${data.id}');">删除</a>&nbsp;
				<a href="javascript:void(0);" onclick="javascript:updateData('${data.id}');">更新</a>&nbsp;
				</td>
				</tr>
				
				</c:forEach>
				
			</table>
			
			<div id="pageStyle">
			${pm.pageNavigation}
			</div>
			
			</form>

		</div>


<script language="javascript">
$(function(){
     $("#table1").find("tr").hover(
	     function(){
	        $(this).addClass("altrow");    //鼠标经过添加hover样式
	     },
	     function(){
	        $(this).removeClass("altrow");   //鼠标离开移除hover样式
	     }
     );
});


</script>

	</body>
</html>

